[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
VS_SemaPhore()       Lock/Unlock a semaphore                              NEW

Description:

  VS_SemaPhore() allows you to lock/unlock a semaphore for transaction
  processing, etc.  Example: Because it is not possible to lock multiple
  records in the same file (without locking the entire file) it is
  sometimes advisable to a semaphore to signal other applications/users
  that you require multiple records to be locked at the same time.  If
  all your programs adhere to the semaphore rules, you can dramatically
  improve the speed and stability of your application.

Syntax:     

  l_Success = VS_SemaPhore( c_SemaPhoreName, c_Initials, l_Lock )

Pass:       

  c_SemaPhoreName is a character expression that should contain the
  name of the semaphore that you want to lock or unlock.  Keep in mind
  that semaphores can be anything you want them to be.  I try to group
  related transactions into groups and then give those groups a name.
  That name is what I use for c_SemaPhoreName.

  c_Initials is a character expression that should contain the
  user's initials.  This can be used with VS_Initials().

  l_Lock is a logical expression that should be set to .T. if you
  want to lock the specified semaphore or to .F. if you want to unlock
  it.

Return:     

  l_Success is a logical expression that will be set to .T. if
  VS_SemaPhore() was successful, otherwise .F.

Notes:      


Example:    

  IF VS_SemaPhore( "ADD_CUST", "VES", .T. )
     AddCust() // Add a new customer
     VS_SemaPhore( "ADD_CUST", "VES", .F. )
   ELSE
     VS_Tell( 3,10,"Unable To Add A New Customer Now!")
  ENDIF

Usage:      

See Also: VS_SemaMins()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson